<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"  isELIgnored="false" %>



<title>注册</title>
<script>
	$(function(){
		
		var msg = "${msg}";
		if(msg.length != 0){
			$("span.errorMessage").html(msg);
			$("div.registerErrorMessageDiv").show();
		}
		
		$(".registerForm").submit(function(){
			if($("#name").val().length == 0){
				$("span.errorMessage").html("请输入用户名");
				$("div.registerErrorMessageDiv").show();
				return false;
			}
			
			if($("#password").val().length == 0){
				$("span.errorMessage").html("请输入密码");
				$("div.registerErrorMessageDiv").show();
				return false;
			}
			
			if($("#repeatpassword").val().length == 0){
				$("span.errorMessage").html("请输入重复密码");
				$("div.registerErrorMessageDiv").show();
				return false;
			}
			if($("#repeatpassword").val() != $("#password").val()){
				$("span.errorMessage").html("重复密码不一致");
				$("div.registerErrorMessageDiv").show();
				return false;
			}
			return true;
		});
		$("form.registerForm input").keyup(function(e){
			if(e.keyCode != 13){
				$("div.registerErrorMessageDiv").hide();
			}
			
		});
	})  
</script>

<form method="post" action="foreregister" class="registerForm">
	<div class="registerDiv">
		<div class="registerErrorMessageDiv">
			<div class="alert alert-danger" role="alert">
				<button type="button" class="close" data-dismiss="alert" aria-label="Close"></button>
				<span class="errorMessage"></span>
			</div>
		</div>
	
		<table align="center" class="registerTable">
			<tbody>
				<tr>
					<td class="registerTip registerTableLeftTD">设置会员名</td>
	            	<td></td>
				</tr>
				<tr>
		            <td class="registerTableLeftTD">登陆名</td>
		            <td class="registerTableRightTD"><input placeholder="会员名一旦设置成功，无法修改" name="user.name" id="name"> </td>
	        	</tr>
	        	<tr>
		            <td class="registerTip registerTableLeftTD">设置登陆密码</td>
		            <td class="registerTableRightTD">登陆时验证，保护账号信息</td>
	        	</tr> 
	        	<tr>
		            <td class="registerTableLeftTD">登陆密码</td>
		            <td class="registerTableRightTD"><input type="password" placeholder="设置你的登陆密码" name="user.password" id="password"> </td>
	        	</tr>
	        	<tr>
		            <td class="registerTableLeftTD">密码确认</td>
		            <td class="registerTableRightTD"><input type="password" placeholder="请再次输入你的密码" id="repeatpassword"> </td>
	        	</tr>
	        	<tr>
	            	<td class="registerButtonTD" colspan="2">
	                	<a href=""><button type="submit">提   交</button></a>
	            	</td>
	        	</tr> 
			</tbody>
		</table>
	</div>
</form>
</html>
